#!/usr/bin/env python3
# coding: utf-8

import numpy as np
import cv2 as cv
file = '../../res/310.mp4'
cap = cv.VideoCapture(file)
while(cap.isOpened()):
    ret, frame = cap.read()
    if not ret:
        print("read video mp4 failed")
        break
    # 黑白视频
    # gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
    cv.imshow('video',frame)
    if cv.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv.destroyAllWindows()